package com.qst.dao;

import java.util.HashMap;
import java.util.Map;

public class DAOFactory {
    private static Map<Class, Object> daos = new HashMap<>();
    static {
        daos.put(UserDao.class, new UserDao());
        daos.put(TestPersonnelDAO.class, new TestPersonnelDAO());
        daos.put(AssessmentTypeDao.class, new AssessmentTypeDao());
        daos.put(QuestionDao.class, new QuestionDao());
        daos.put(DimensionDao.class, new DimensionDao());
        daos.put(ChoiceDao.class, new ChoiceDao());
        daos.put(ScheduleDao.class, new ScheduleDao());
        daos.put(TeamDao.class, new TeamDao());
        daos.put(ExamDao.class, new ExamDao());
        daos.put(ExamQuestionDAO.class, new ExamQuestionDAO());
    }

    public static<T> T getDao(Class<T> clazz) {
        return (T) daos.get(clazz);
    }
}
